#define _CRT_SECURE_NO_WARNINGS 1
#include <vector>
#include <unordered_set>
using namespace std;
class Solution {
public:
    vector<int> FindNumsAppearOnce(vector<int>& nums)
    {
        unordered_set<int> unset;
        for (int i = 0;i < nums.size();++i)
        {
            if (unset.find(nums[i]) == unset.end())
            {
                //cerr<<"insert="<<nums[i]<<endl;
                unset.insert(nums[i]);
            }
            else
            {
                //cerr<<"erase="<<nums[i]<<endl;
                unset.erase(nums[i]);
            }
        }
        vector<int> ret;
        for (auto a : unset)
        {
            ret.push_back(a);
        }
        if (ret[0] > ret[1])
        {
            swap(ret[0], ret[1]);
        }
        return ret;
    }
};